package main

import (
	"hong/uniapp_server/application"
	"hong/uniapp_server/domain/diary"
	"hong/uniapp_server/domain/user"
	"hong/uniapp_server/infrstructure/dao"
	diary_impl "hong/uniapp_server/infrstructure/impl/diary"
	user_impl "hong/uniapp_server/infrstructure/impl/user"
)

var (
	logController      *application.LogController

	userDao *dao.UserDao
	userRepository user.UserRepository
	userService *user.UserService
	authController *application.AuthController

	userPhotoDao *dao.UserPhotoDao
	userPhotoRepository user.UserPhotoRepository
	userPhotoService *user.UserPhotoService

	diaryDao           *dao.DiaryDao
	diaryRepository    diary.DiaryRepository
	diaryService       *diary.DiaryService
	diaryController    *application.DiaryController
)

func dependencyInjection() {
	logController = application.NewLogController()

	userDao = dao.NewUserDao()
	userRepository = user_impl.NewUserRepositoryImpl(userDao)
	userService = user.NewUserService(userRepository)
	authController = application.NewAuthController(userService)

	userPhotoDao = dao.NewUserPhotoDao()
	userPhotoRepository = user_impl.NewUserPhotoRepositoryImpl(userPhotoDao)
	userPhotoService = user.NewUserPhotoService(userPhotoRepository)

	diaryDao = dao.NewDiaryDao()
	diaryRepository = diary_impl.NewDiaryRepositoryImpl(diaryDao)
	diaryService = diary.NewDiaryService(diaryRepository)
	diaryController = application.NewDiaryController(diaryService, userPhotoService)
}
